import request from "@/util/request.js";

// 获取分类数据
export function getDataCat(params) {
    return request({
        url: "/api/dataGeneration/dataCat/?" + params,
        method: "get",
    });
}

export function postDataCat(data) {
    return request({
        url: "/api/dataGeneration/dataCat/",
        method: "post",
        data:data,
    });
}

export function getDataCatById(id) {
    return request({
        url: "/api/dataGeneration/dataCat/" + id +"/",
        method: "get",
    });
}

export function patchDataCat(id,data) {
    return request({
        url: "/api/dataGeneration/dataCat/" + id +"/",
        method: "patch",
        data:data,
    });
}

export function deleteDataCat(id) {
    return request({
        url: "/api/dataGeneration/dataCat/" + id +"/",
        method: "delete",
    });
}



// 获取数据类型参数配置
export function getDataArgs(params) {
    return request({
        url: "/api/dataGeneration/dataArgs/?" + params,
        method: "get",
    });
}

export function getDataArgsById(id) {
    return request({
        url: "/api/dataGeneration/dataArgs/" + id +"/",
        method: "get",
    });
}


export function getCatOptions() {
    return request({
        url: "/api/dataGeneration/catOptions/",
        method: "get",
    });
}


export function postDataArgs(data) {
    return request({
        url: "/api/dataGeneration/postDataArgs/",
        method: "post",
        data:data,
    });
}

export function updateDataArgs(data) {
    return request({
        url: "/api/dataGeneration/updateDataArgs/",
        method: "post",
        data:data,
    });
}

export function deleteDataArgs(data) {
    return request({
        url: "/api/dataGeneration/deleteDataArgs/",
        method: "post",
        data:data,
    });
}


export function updateDataArgsIsEnable(data) {
    return request({
        url: "/api/dataGeneration/updateDataArgsIsEnable/",
        method: "post",
        data:data,
    });
}